﻿@model TaxTypeSelectorModel
@using Nop.Core
@using Nop.Core.Domain.Tax
@using Microsoft.AspNetCore.Http
@using System.Net
@inject IWebHelper webHelper
@inject IHttpContextAccessor httpContextAccessor
@{
    var rawUrl = webHelper.GetRawUrl(httpContextAccessor.HttpContext.Request);

    var taxTypes = new List<SelectListItem>();
    taxTypes.Add(new SelectListItem
    {
        Text = T("Tax.Inclusive").Text,
        Value = webHelper.ModifyQueryString(Url.RouteUrl("ChangeTaxType", new { customertaxtype = ((int)TaxDisplayType.IncludingTax) }, webHelper.CurrentRequestProtocol), "returnurl", rawUrl),
        Selected = Model.CurrentTaxType == TaxDisplayType.IncludingTax
    });
    taxTypes.Add(new SelectListItem
    {
        Text = T("Tax.Exclusive").Text,
        Value = webHelper.ModifyQueryString(Url.RouteUrl("ChangeTaxType", new { customertaxtype = ((int)TaxDisplayType.ExcludingTax) }, webHelper.CurrentRequestProtocol), "returnurl", rawUrl),
        Selected = Model.CurrentTaxType == TaxDisplayType.ExcludingTax
    });
}
<div class="tax-display-type-selector">
    <select id="customerTaxType" name="customerTaxType" asp-items="@taxTypes" onchange="setLocation(this.value);"></select>
</div>